package com.java_senior_1;

public class Book implements Comparable {
    private String name;
    private double price;

    public Book(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public Book() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    public int  compareTo(Object obj){
        Book book=(Book)obj;
        if (this.price>book.price){
            return 1;
        }else if (this.price==book.price){
            return 0;
        }
        return -1;
    }
}
